package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.example.day01.BIM.BIMHealthActivity;
import com.example.day01.Photo_Wall.PhotoWallActivity;
import com.example.day01.book.BookSpActivity;
import com.example.day01.cacluatue.CalculatorActivity;
import com.example.day01.finger_guest.GuestActivity01;
import com.example.day01.lunbo.BannerActivity;
import com.example.day01.register.RegisterActivity;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {
    Button btn1,btn2,btn3,btn4,btn5,btn6,btn7,btn8;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
    }

    private void initView() {
        //初始化控件
        btn1=findViewById(R.id.main_btn_1);
        btn2=findViewById(R.id.main_btn_2);
        btn3=findViewById(R.id.main_btn_3);
        btn4=findViewById(R.id.main_btn_4);
        btn5=findViewById(R.id.main_btn_5);
        btn6=findViewById(R.id.main_btn_6);
        btn7=findViewById(R.id.main_btn_7);
        btn8=findViewById(R.id.main_btn_8);
        //设置监听器
        btn1.setOnClickListener(this);
        btn2.setOnClickListener(this);
        btn3.setOnClickListener(this);
        btn4.setOnClickListener(this);
        btn5.setOnClickListener(this);
        //btn6.setOnClickListener(this);
        btn7.setOnClickListener(this);
        btn8.setOnClickListener(this);


    }

    @Override
    public void onClick(View v) {
        Intent intent=new Intent();
        switch (v.getId()) {
            case R.id.main_btn_1:
                intent.setClass(MainActivity.this, RegisterActivity.class);

                break;
            case R.id.main_btn_2:
                intent.setClass(MainActivity.this, CalculatorActivity.class);
                break;
            case R.id.main_btn_3:
                intent.setClass(MainActivity.this, GuestActivity01.class);
                break;
            case R.id.main_btn_4:
                intent.setClass(MainActivity.this, BIMHealthActivity.class);
                break;
            case R.id.main_btn_5:
                intent.setClass(MainActivity.this, BookSpActivity.class);
                break;
            case R.id.main_btn_6:

                break;
            case R.id.main_btn_7:
                intent.setClass(MainActivity.this, PhotoWallActivity.class);
                break;
            case R.id.main_btn_8:
                intent.setClass(MainActivity.this, BannerActivity.class);
                break;

        }
        startActivity(intent);

    }
}
